<?php

class Model_Products_Ebaycategory extends Zend_Db_Table_Abstract {

	protected $_name = 'ebay_category';
	
	public function getEbaycategory( $idCategory){
		
		$row = $this->fetchRow("`id_category` = ". $idCategory);
		if(!$row) return false;
		return $row->toArray();		
		
		}
		
	public function addEbaycategory( $titleCategory , $idEbayCategory){
		
		$data = array(
			
         "title_category" =>  $titleCategory ,
         "id_ebay_category" =>  $idEbayCategory 
	
			);
		$this->insert($data);
		
		}
		
	public function updateEbaycategory(  $idCategory ,  $titleCategory , $idEbayCategory){
		$data = array(
			
         "title_category" =>  $titleCategory ,
         "id_ebay_category" =>  $idEbayCategory 
	
			);
			
		$this->update($data,"`id_category` = ". $idCategory);
		}
		
	public function deleteEbaycategory( $idCategory){
		
		$this->delete("`id_category` = ". $idCategory);
		
		}	
	
	public function listAll(){
		
		$rows =$this->fetchAll("1","id_category DESC ");
		if(!$rows) return false;
		return $rows->toArray();			
		
		}	
}


?>